#ifndef XLCOMM_NET_CALLBACKS_H_
#define XLCOMM_NET_CALLBACKS_H_

#include <functional>
#include <memory>

#include "xlcomm/base/date_time.h"

namespace xlcomm {

using std::placeholders::_1;
using std::placeholders::_2;
using std::placeholders::_3;

namespace net {

class Buffer;
class TcpConnection;

using TcpConnectionPtr = std::shared_ptr<TcpConnection>;
using TimerCallback = std::function<void()>;
using ConnectCallback = std::function<void(const TcpConnectionPtr& conn)>;
using DisconnectCallback = std::function<void(const TcpConnectionPtr& conn)>;
using WriteCompleteCallback = std::function<void(const TcpConnectionPtr& conn)>;
using OutbufHighWaterCallback =
    std::function<void(const TcpConnectionPtr& conn, size_t remain_bytes)>;
using MessageCallback = std::function<void(const TcpConnectionPtr& conn,
                                           Buffer* buff, Timestamp recv_time)>;
using CloseCallback = std::function<void(const TcpConnectionPtr& conn)>;

}  // namespace net
}  // namespace xlcomm

#endif  // XLCOMM_NET_CALLBACKS_H_